<template>
    <div>
        <p> {{ goodsDesc.title }} </p>
        <hr>
        <div v-html="goodsDesc.content" class="goods-desc-body"></div>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                id: this.$route.params.id,
                goodsDesc: {},
            }
        },
        created () {
            this.getGoodsDesc();
        },
        methods: {
            getGoodsDesc () {
                this.$http.get( 'api/goods/getdesc/' + this.id ).then(res => {
                    if (res.body.status === 0){
                        this.goodsDesc = res.body.message[0]
                    } else {
                        this.$toast('商品介绍获取失败')
                    }
                })
            },
        },
    }
</script>

<style lang="scss">

.goods-desc-body {
    img {
        vertical-align: top;
        width: 100%;
    }
}
    
</style>
